package com.zhuhjay.common.enums;

/**
 * 响应Http的状态码枚举
 * @author ZhuHJay
 * @date 2022/3/24 10:26
 */
public enum HttpCode {
    /** 状态码 **/
    SUCCESS(200, "操作成功"),
    UPDATE_SUCCESS(201, "修改成功"),
    DELETE_SUCCESS(202, "删除成功"),
    USER_ERROR(300, "操作失败"),
    LOGIN_FAILURE(401, "登录失效"),
    SERVER_ERROR(500, "服务器异常");

    private final int code;
    private final String desc;

    private HttpCode(int code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }
}
